import pandas as pd
from utils.dataManager import Data_Collector,Beat_Response_Table

data_manager = Data_Collector()
if __name__ == '__main__':
    # df = pd.read_csv("dataset/2021-09-16_21-27-20__2021-09-16_21-29-22.csv")
    df = pd.read_csv("dataset/2022-03-23_10-42-00__2022-03-23_10-52-20.csv")
    x_columns = ['beat_startT', 'beat_responeT']
    y_columns = ['beat_key', 'beat_resKey']
    df = data_manager.preProcess(df, y_columns)
    x_axis, y_axis = data_manager.df_2_lineChart(df, x_columns, y_columns)

    # 绘制曲线
    label_names = ['real', 'response']
    data_manager.beat_response_lineChart_plot(x_axis, y_axis, label_names=label_names)

    # 结束计时，初始化data_manager中的beat_table
    data_manager.beat_table = Beat_Response_Table()